﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="PlasmaServer.Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:Panel runat="server" ID="panelLogin"><br />
    <asp:Label runat="server" ID="lbError"></asp:Label>
    Login: <asp:TextBox runat="server" ID="tbLogin"></asp:TextBox>&nbsp;&nbsp;&nbsp;Password: <asp:TextBox runat="server" ID="tbPassword" TextMode="Password"></asp:TextBox>&nbsp;&nbsp;<asp:Button runat="server"	 ID="btnLogin"  Text="Login" OnClick="btnLoginClicked"/>
    </asp:Panel>
    
    <div>
    
    Search: <asp:TextBox runat="server"	 ID="tbName" ontextchanged="tbName_TextChanged" ></asp:TextBox>
			<asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
				AutoGenerateColumns="False" AutoGenerateDeleteButton="True" CellPadding="4" 
				DataSourceID="lqResources" ForeColor="#333333" GridLines="None" 
				AllowPaging="True" PageSize="15">
				<RowStyle BackColor="#EFF3FB" />
				<Columns>
				
					<asp:HyperLinkField DataNavigateUrlFields="ResourceID" 
						DataNavigateUrlFormatString="~/ResourceDetail.aspx?resourceID={0}" 
						DataTextField="InternalName" HeaderText="InternalName" 
						SortExpression="InternalName" />
				
					<asp:BoundField DataField="InternalName" HeaderText="InternalName" 
						ReadOnly="True" SortExpression="InternalName" />
					<asp:BoundField DataField="LastLinkCheck" HeaderText="LastLinkCheck" 
						ReadOnly="True" SortExpression="LastLinkCheck" />
					<asp:BoundField DataField="TypeID" HeaderText="Type" ReadOnly="True" 
						SortExpression="TypeID" />
						<asp:BoundField DataField="DownloadCount" HeaderText="Downloads" ReadOnly="True" SortExpression="DownloadCount" />
						<asp:BoundField DataField="NoLinkDownloadCount" HeaderText="Failed downloads" ReadOnly="True" SortExpression="NoLinkDownloadCount" />
					<asp:TemplateField HeaderText="Image">
						<ItemTemplate>
							<a runat="server" href='<%# Eval("InternalNameEscaped", "~/Resources/{0}.minimap.jpg") %>'>
							<img runat="server" src='<%# Eval("InternalNameEscaped", "~/Resources/{0}.minimap.jpg") %>' height="50" />
							</a>
						</ItemTemplate>
					</asp:TemplateField>
				</Columns>
				<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
				<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
				<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
				<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
				<EditRowStyle BackColor="#2461BF" />
				<AlternatingRowStyle BackColor="White" />
			</asp:GridView>
    	<asp:LinqDataSource ID="lqResources" runat="server" 
				ContextTypeName="PlasmaServer.DbDataContext" EnableDelete="True" 
						TableName="Resources" OnSelecting="lqResources_Selecting" 
				ondeleting="lqResources_Deleting">
			</asp:LinqDataSource>
    </div>
    </form>
</body>
</html>
